package com.yoshino.factory.abstract_factory.order;

import com.yoshino.factory.abstract_factory.pizza.BJCheesePizza;
import com.yoshino.factory.abstract_factory.pizza.BJPepperPizza;
import com.yoshino.factory.abstract_factory.pizza.Pizza;

/**
 * 工厂子类
 * @author yoshino
 **/
public class BJFactory implements AbsFactory{
    @Override
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if ("cheese".equals(orderType)) {
            pizza = new BJCheesePizza();
        } else if ("pepper".equals(orderType)) {
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}
